package com.fa.wisdom.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fa.wisdom.R;
import com.fa.wisdom.model.DeviceEntity;

import java.util.List;

public class DeviceAdapter extends BaseQuickAdapter<DeviceEntity, BaseViewHolder> {
    private List<DeviceEntity> list;

    public DeviceAdapter(List<DeviceEntity> newsList) {
        super(R.layout.item_device_home, newsList);
        this.list = newsList;
    }

    @Override
    protected void convert(BaseViewHolder helper, DeviceEntity item) {
        ImageView iv=helper.getView(R.id.iv_img);
        TextView tv_name=helper.getView(R.id.tv_name);
        TextView time=helper.getView(R.id.tv_time);
        tv_name.setText(item.getName());
        time.setText(item.getCreateTime());
        switch (item.getId()){
            case 22://定位手环
                iv.setImageResource(R.drawable.ranqijc);
                break;
            case 2://摄像机
                iv.setImageResource(R.drawable.camera);
                break;
            case 17://红外
                iv.setImageResource(R.drawable.hongwai);
                break;
            case 16://求救
                iv.setImageResource(R.drawable.qiujiu);
                break;
//            case 22://定位手环
//                break;
//            case ://摄像机
//                break;
//            case 22://定位手环
//                break;
//            case ://摄像机
//                break;
        }
    }
}
